package homework_1.Guess;
import java.util.Random;

/**
 * @Author 朱志文
 * @Date 2019/3/13 9:30
 */
public class Guess {
    Random ra=new Random();
    private int random=ra.nextInt(10);

    public Guess(int random) {
        this.random = random;
    }

    public Guess(){
    }

    public int getRandom() {
        return random;
    }

    public void setRandom(int random) {
        this.random = random;
    }

    void guess(int random,int num,int time){
        if (num==random){
            System.out.println("binGo");
            System.out.println(" 一共猜了："+(time+1));
            System.out.println("Game Over");
            System.exit(0);
        }else if (num<random){
            System.out.println("smaller");
        }else {
            System.out.println("bigger");
        }
    }
}
